#include <iostream>

using namespace std;

int arr[502] = {0};

void qsort(int s,int e){
	int i = s;
	int j = e;
	int mid = arr[(i+j) / 2];

	while (i <= j){
		while (arr[i] < mid) i++;
		while (arr[j] > mid) j--;

		if (i <= j){
			int t = arr[i];
			arr[i] = arr[j];
			arr[j] = t;
			i++,j--;
		}

	}
	if (s < j) qsort(s,j);
	if (i < e) qsort(i,e);
}




int main(){
	int i,k,n;
	int l = 0,r = 0;

	cin >> n;

	r = n- 1;

	for (i = 0;i < n;i++){
		cin >> arr[i];
	}


	while (l <= r){
		while (arr[l] % 2 == 1) l++;
		while (arr[r] % 2 == 0) r--;

		if (l <= r){
			int t = arr[l];
			arr[l] = arr[r];
			arr[r] = t;
			l++;r--;
		}
	}


	qsort(0,r);

	for (k = 0;k < r;k++){
		cout << arr[k] << ",";
	}
	cout << arr[k] << endl;


}